import {
  request
} from './request'
// import { request } from './request2'
// 获取视频标签列表
export function getVideoTag() {
  return request({
    url: '/video/group/list?cookie=' + sessionStorage.getItem("cookie"),
    params: {

    }
  })
}

//获取视频
export function getVideo(id) {
  return request({
    url: '/video/group?cookie=' + sessionStorage.getItem("cookie"),
    params: {
      id,
    }
  })
}

//获取全部视频
export function getAllVideo() {
  return request({
    url: '/video/timeline/recommend?cookie=' + sessionStorage.getItem("cookie"),
    // withCredentials: true,
    params: {}
  })
}

//获取视频详情

export function getVideoInfo(id) {
  return request({
    url: '/video/detail?cookie=' + sessionStorage.getItem("cookie"),
    params: {
      id
    }
  })
}

//获取视频url
export function getVideoUrl(id) {
  return request({
    url: '/video/url?cookie=' + sessionStorage.getItem("cookie"),
    params: {
      id
    }
  })
}


// 获取 mv 点赞转发评论数数据
export function getVideoCount(vid) {
  return request({
    url: '/video/detail/info',
    params: {
      vid
    }
  })
}



// 获取评论数据
export function getVideoComment(id, limit, offset) {
  return request({
    url: '/comment/video?cookie=' + sessionStorage.getItem("cookie"),
    params: {
      id,
      limit,
      offset
    }
  })
}

//获取相关视频
export function getVideoRecommend(id) {
  return request({
    url: '/related/allvideo',
    params: {
      id,
    }
  })
}


//获取MV
export function getAllMv(area, type, order, limit,offset) {
  return request({
    url: '/mv/all',
    params: {
      area,
      type,
      order,
      limit,
      offset
    }
  })
}

//获取mv地址
export function getAllMvUrl(id) {
  return request({
    url: '/mv/url',
    params: {
      id
    }
  })
}

//获取mv详细数据
export function getMvDetail(mvid) {
  return request({
    url: '/mv/detail',
    params: {
      mvid
    }
  })
}

// 获取 mv 点赞转发评论数数据
export function getMvInfo(mvid) {
  return request({
    url: '/mv/detail/info?cookie=' + sessionStorage.getItem("cookie"),
    params: {
      mvid
    }
  })
}

//获取mv评论

export function getMvComment(id, limit, offset) {
  return request({
    url: '/comment/mv?cookie=' + sessionStorage.getItem("cookie"),
    params: {
      id,
      limit,
      offset
    }
  })
}

//获取推荐mv
export function getMvRecommend(mvid) {
  return request({
    url: '/simi/mv',
    params: {
      mvid
    }
  })
}

//获取最近播放
export function getRecommendPlay(uid) {
  return request({
    url: '/user/record',
    params: {
      uid,
      type: 0
    }
  })
}

//给视频mv等点赞功能
export function giveLike(type, t, id) {
  return request({
    url: '/resource/like?cookie=' + sessionStorage.getItem("cookie"),
    params: {
      type,
      t,
      id
    }
  })
}

// 收藏/取消收藏 视频
export function getVideoCollect(id, t) {
  return request({
    url: '/video/sub?cookie=' + sessionStorage.getItem("cookie"),
    params: {
      id,
      t
    }
  })
}
// 收藏/取消收藏 Mv
export function getMvCollect(mvid, t) {
  return request({
    url: '/mv/sub?cookie=' + sessionStorage.getItem("cookie"),
    params: {
      mvid,
      t
    }
  })
}
//获取标签
export function getTags() {
  return request({
      url: '/playlist/highquality/tags',
      params: {
      }
  })
}


